package com.totoro.exception;

/**
 * @author TOTORO
 * @date 2021/7/15 9:30
 * 错误码枚举
 */
public enum ResultCode {
    /** 成功 */
    SUCCESS("0", "success!"),
    /** 未知错误 */
    UNKNOWN_ERROR("0x10001", "unkonwn error!"),
    /** url参数不完整缺少错误 */
    PARAM_ERROR("0x10002", "param incomplete or error!"),


    /** 用户未登录 */
    USER_NOT_LOGGED_IN("0x10003", "user not logged in!"),
    /** 用户名错误或不存在 */
    USERNAME_ERROR("0x10004", "username error or does not exist!"),
    /** 密码错误 */
    PASSWORD_ERROR("0x10005", "password error!"),
    /** 用户名不能为空 */
    USERNAME_EMPTY("0x10006", "username can not be empty!"),

    /** 购物车商品重复 */
    CART_PRODUCT_REPEAT("0x10007", "cart product repeat!"),
    /** 删除的数据发生错误 */
    DELETE_DATA_ERROR("0x10008", "An error occurred while deleting data!"),

    /** 订单状态不存在 */
    ORDER_STATUS_UNKNOWN("0x10009", "Unknown order status");





    /**
     * 结果码
     */
    private String code;

    /**
     * 结果码描述
     */
    private String msg;


    ResultCode(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
